<template>
	<view class="answer-list-wrapper">
		<view class="answer-item" v-for="(answer,index) in list" :key="index">
			<view class="left">
				<u-image width="80rpx" height="80rpx" :src="answer.avatar" border-radius="50%"></u-image>
			</view>
			<view class="right">
				<view class="name-wrap">
					<view>{{answer.nickname}}</view>
					<view>{{answer.time}}</view>
				</view>
				<view class="answer-content">
					<view>
						{{answer.content}}
					</view>
					<view class="answer-image">
						<u-image :src="img" width="180rpx" height="180rpx" v-for="img in answer.images" :key="img"></u-image>
					</view>
				</view>
				<view class="reply-content">
					<view class="reply-item" v-for="reply in answer.list" :key="reply.id">
						<view class="reply-text">
							<text>{{reply.is_probe===1?'老师回复：':`${answer.nickname}：`}}</text>
							<text> {{reply.content}}</text>
						</view>
						<view class="answer-image">
							<u-image :src="img" width="120rpx" height="120rpx" v-for="img in reply.images" :key="img"></u-image>
						</view>
						<view class="add-reply-btn">追问</view>
					</view>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {

			}
		}
	}
</script>

<style lang="scss" scoped>
	.answer-list-wrapper {
		padding: 0 30rpx;

		>.answer-item {
			display: flex;
			border-bottom: 1rpx solid #F5F2ED;
			padding: 30rpx 0;

			>.left {
				margin-right: 20rpx;
			}

			>.right {
				padding-top: 10rpx;
				flex: 1;

				>.name-wrap {
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 26rpx;
					color: #8A857C;
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding-bottom: 30rpx;

					>view {
						&:last-child {
							font-size: 24rpx;
							color: #B0A99E;
						}
					}
				}

				>.answer-content {
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: #292621;
					padding-bottom: 27rpx;


				}

				.answer-image {
					display: flex;
					flex-wrap: wrap;
					margin-top: 20rpx;
					gap: 16rpx;
				}

				>.reply-content {
					background: rgba(240, 97, 3, 0.05);
					border-radius: 15rpx;
					padding: 20rpx 20rpx 0 20rpx;
					border-radius: 15rpx;

					>.reply-item {
						padding-bottom: 28rpx;

						>.reply-text {
							>text {
								font-family: Adobe Heiti Std;
								font-weight: normal;
								font-size: 26rpx;
								color: #292621;

								&:first-child {

									color: #8A857C;
								}
							}
						}


						.add-reply-btn {
							width: 100rpx;
							height: 40rpx;
							background: linear-gradient(-90deg, #FA4E4E, #FD894F);
							border-radius: 5rpx;
							font-weight: 500;
							font-size: 24rpx;
							color: #FFFFFF;
							text-align: center;
							line-height: 40rpx;
							margin-top: 20rpx;
						}
					}
				}
			}
		}
	}
</style>